package com.second.app.thread.haswaiters;

/**
 * @author gyz
 * @date 2021/2/2 15:47
 */
public class Run {
    public static void main(String[] args) {
        try {
            Service service = new Service();
            Runnable runnable = () -> service.waitMethod();
            Thread[] threadArray = new Thread[10];
            for (int i = 0; i < 10; i++) {
                threadArray[i] = new Thread(runnable);
                threadArray[i].start();
            }
            Thread.sleep(1000);
            service.wakeUp();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
